#include <iostream>
#include <vector>
#include <ctime>


class Test
{
  public:
    static const int count = 100000;
    int array[count];
};

void TestFunction1(Test x){}
void TestFunction2(Test& x){}

void TestRefAndValue()
{
    Test t;
    //测试传值时间
    int begin1 = clock();
    for(int i = 0; i < t.count; i++)
    {
        TestFunction1(t);
    }
    int end1 = clock();

    // 测试传引用时间
    int begin2 = clock();
    for(int i = 0; i < t.count; i++)
    {
        TestFunction2(t);
    }
    int end2 = clock();
    
    std::cout << "传值时间测试: " << end1 - begin1 << std::endl;
    std::cout << "传引用时间测试: " << end2 - begin2 << std::endl;
}


int main()
{
    TestRefAndValue();
    return 0;
}